<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
        content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
</head>

<body layadmin-themealias="default">

    <div class="layui-fluid">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-body" pad15="">

                        <div class="layui-form" wid100="" lay-filter="">
                            <input type="hidden" name="id" value="{$info.id}">
                            <div class="layui-form-item">
                                <label class="layui-form-label">渠道标识</label>
                                <div class="layui-input-inline">
                                    <div class="layui-form-mid ">{$info.source_key}</div>
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label">渠道名称</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="source_name" value="{$info.source_name}"
                                        class="layui-input" lay-verify="required" placeholder="请输入">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">设备通道</label>
                                <div class="layui-input-inline">
                                    <div class="layui-form-mid ">{$info->device_text}</div>
                                </div>
                            </div>

                            <div class="layui-form-item" {$info.device!=3?'style="display:none"':''}>
                            <label class="layui-form-label">网址</label>
                            <div class="layui-input-inline">
                                <input type="text" name="url" value="{$info.url}" class="layui-input" lay-verify="" placeholder="请输入域名(www.abc.com)">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">备注</label>
                            <div class="layui-input-inline">
                                <input type="text" name="description" value="{$info.description}" class="layui-input" lay-verify="" placeholder="请输入">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">是否绿包</label>
                            <div class="layui-input-block">
                                <input type="radio" value="1" name="sem" title="是" {eq name="$info.sem" value="1"
                                    }checked{/eq} />
                                <input type="radio" value="0" name="sem" title="否" {eq name="$info.sem" value="0"
                                    }checked{/eq} />
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">特殊渠道</label>
                            <div class="layui-input-block">
                                <input type="radio" value="1" name="spec" title="是" {eq name="$info.spec" value="1"
                                    }checked{/eq} />
                                <input type="radio" value="0" name="spec" title="否" {eq name="$info.spec" value="0"
                                    }checked{/eq} />
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">悦动圈渠道</label>
                            <div class="layui-input-block">
                                <input type="radio" value="1" name="joycircle" title="是" {eq name="$info.joycircle" value="1"
                                    }checked{/eq} />
                                <input type="radio" value="0" name="joycircle" title="否" {eq name="$info.joycircle" value="0"
                                    }checked{/eq} />
                            </div>
                        </div>
                        <div class="layui-form-item" style="display: none">
                            <label class="layui-form-label">状态</label>
                            <div class="layui-input-inline">
                                <select name="status" lay-verify="required">
                                    <option value="1" {$info.status==1?' selected':''}>正常</option>
                                <option value="0" {$info.status==0?'selected':''}>冻结</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">创建时间</label>
                            <div class="layui-input-inline">
                                <div class="layui-form-mid ">{$info.create_time}</div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-input-block text-center">
                                <button class="layui-btn" lay-submit="" lay-filter="regsource-edit">确认保存</button>
                                <button class="layui-btn layui-btn-primary" id="close">取消</button>
                            </div>
                        </div>
                    </div>

                </div>
            </div>
        </div>
    </div>
    </div>

    <script src="/layuiadmin/layui/layui.js"></script>
    <script>
        layui.config({
            base: '/layuiadmin/' //静态资源所在路径
            , version: "{:config('other.ui_version')}"
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'form', 'admin', 'regsource'], function () {
            var $ = layui.$
                , form = layui.form
                , admin = layui.admin;
            var index = parent.layer.getFrameIndex(window.name);

            $('#close').on("click", function () {
                parent.layer.close(index);
            });

            form.on('submit(regsource-edit)', function (obj) {
                layer.load();
                //提交
                admin.req({
                    url: '{:url("regsource/edit")}'
                    , data: obj.field
                    , success: function (res) {
                        layer.closeAll("loading");
                        if (res.code == 0) {
                            parent.layer.close(index);
                            parent.layer.msg(res.msg, { icon: 1 });
                            parent.layui.table.reload('LAY-regsource-manage');
                        }
                    }
                    , complete: function () {
                        layer.closeAll("loading");
                    },
                });
                return false;
            });
        });
    </script>
</body>

</html>